// configuration module, added by regret
#ifndef CONFIG_H
#define CONFIG_H

#include "../lib/ticpp/ticpp.h"

class Config {
public:
	Config();
	virtual ~Config();

	static bool save();
	static bool load();
	static void setSaveEnable(bool enable);

	static float version();

private:
	static const float configVersion;
	static bool saveEnabled;
	static int cfgVersion;

	static void createConfigName(char* config);

	static inline ticpp::Element* findElement(ticpp::Element* element, const char* attr);
	static inline void addTextNode(ticpp::Element& parent, const char* title, const char* value);
	template <typename T>
	static inline void setAttr(ticpp::Element& element, const char* attr, const T& value);
	template <typename T>
	static inline void getAttr(ticpp::Element* element, const char* attr, T* value);
	static inline void getTextAttr(ticpp::Element* element, const char* attr, wchar_t* name);
	static inline void getTextStr(ticpp::Element* element, wchar_t* name);
};

#endif
